package com.iwhalecloud.bss.kite.cucc.service.listener;

import com.iwhalecloud.bss.kite.client.vo.scene.ProductModuleVO;
import com.iwhalecloud.bss.kite.cucc.service.even.GroupProdAttrEvent;
import com.iwhalecloud.bss.kite.cucc.service.listener.handler.DivideProdAttrHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhu
 * @since 2020/04/23
 */
@Service
public class GroupProdAttrListener {

    @Autowired
    private DivideProdAttrHandler divideProdAttrHandler;

    @EventListener
    @Order(1)
    public void divideProdAttr(GroupProdAttrEvent event) {
        String sceneInstId = event.getSceneInstId();
        String custId = event.getCustId();
        List<ProductModuleVO> productModuleVOList = event.getProductModuleVOList();
        divideProdAttrHandler.divideProdAttr(sceneInstId, custId, productModuleVOList);
    }

}
